package com.func.infrastructure.persistent.dao.activity;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import com.func.infrastructure.persistent.po.activity.UserRaffleOrder;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * IUserRaffleOrderDao
 * </p>
 *
 * @author Simon
 * @version 2025.03.14.1.0.0
 * @description
 * @since 2025-03-14
 */

@Mapper
@DBRouterStrategy(splitTable = true)
public interface IUserRaffleOrderDao {
    /**
     * 查询用户没有用过的订单
     * @param userRaffleOrderReq activityId, userId
     * @return 查到的用户的订单
     */
    @DBRouter
    UserRaffleOrder queryNoUsedRaffleOrder(UserRaffleOrder userRaffleOrderReq);

    /**
     * 将活动订单入库
     * @param userRaffleOrder 活动订单
     */
    void insert(UserRaffleOrder userRaffleOrder);

    int updateUserRaffleOrderCompleted(UserRaffleOrder userRaffleOrder);
}
